***************************************************************************
***************************************************************************
* Title: THE HILLARY HYPOTHESES - TESTING CANDIDATE VIEWS OF LOSS 
* Authors: Michael Lewis-Beck and Stephen Quinlan
* 
* STATA Data Anaylsis Syntax File
* Data to be run on .dta file with variable transformations applied. 
* (Original ANES data version date: December 19, 2017)
* Last updated: Friday 19 October 2018
***************************************************************************
***************************************************************************


***************************************************************************
* NAVIGATION OF SYNTAX FILE
* /// = SECTION HEADER 
* >>> = ANALYSIS HEADER
* <<< = SUB ANALYSIS HEADER
* \\\ = HEADER FOR DIFFERENT LOOPS OF CODE WITHIN AN ANALYSIS
* FIGURE = Search by Figure Number in paper 
* TABLE = Search by Table Number in paper 

* The file is split up in accordance with the paper and stats/models 
* presented in each section as well as references to the appendix. 
**************************************************************************** 


****************************************************************************
* SYNTAX FILE IS SPLIT UP INTO FOLLOWING SECTIONS:
* /// 1: GET DATA
* /// 2: PUT ON STRATA WEIGHT 
* /// 3: SUMMARY STATS OF RELEVANT VARIABLES (Table B1 in appendix)
* /// 4: PARTISANSHIP - THE ELEPHANT IN THE ROOM (Section 3 of paper)
* /// 5: THE DEMOCRATIC BASE (Section 4 of paper)
* /// 6: CULTURAL ANXIETY - ANGER AT IMMIGRANTS AND MINORIITES (Section 5 of paper)
* /// 7: IT'S THE ECONOMY STUPID (Section 6 of paper)
* /// 8. CANDIDATE PERSONALITY AND GENDER - DINGED (Section 7 of paper) 
* /// 9: THE CAMPAIGN - EMAILS AND COMEY (Section 8 of paper)
* /// 10: THE RELATIVE IMPORTANCE: MULTIVARIATE ANAYLSIS (Section 9 of paper)
* /// 11: HH SCORECARD (Section 10 of paper)
****************************************************************************


***************************************************************************
***************************************************************************
*/// 1: GET DATA
***************************************************************************
***************************************************************************

clear
use "D:\Dropbox (CSES)\SQ Research\Mike_Hillary Hypothesis\Data\USA_20180730.DTA"


***************************************************************************
***************************************************************************
*/// 2: PUT ON STRATA WEIGHT
***************************************************************************
***************************************************************************

svyset [pweight=V160102], strata(V160201) psu(V160202)


***************************************************************************
***************************************************************************
*/// 3: SUMMARY STATS OF VARIABLES FOR THIS ANALYSIS 
*    Detailed in Table B1 in appendix
***************************************************************************
***************************************************************************

summarize Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 EconomySocio_BetterWorseYr_Retro Eco_FreeTradeAgree TradWomenIndex_2 HostileSexismIndex_2 ClintonDislike_Personality ClintonDislike_Email MakeUpMindVote Income4_PRE_3CAT DOI_PRE FollowPolinMedia if Turnout16USA==1.


***************************************************************************
/// 4: PARTISANSHIP - THE ELEPHANT IN THE ROOM
***************************************************************************

***************************************************************************
*>>> TABLE C1 APPENDIX
*    Partisanship Frequency with weighting
***************************************************************************

svy: tab PartyID_US_PRE if Turnout16USA==1


***************************************************************************
*>>> FIGURE C1 APPENDIX
***************************************************************************

*<<< Bivariate relationship: vote and Partisanship with weighting
svy: tab Vote16 PartyID_US_PRE_3CATEG , col 

*<<< Basic Logit model: Clinton vote and Partisanship
svy: logit Vote16_Clinton PartyID_US_PRE_3CATEG if Turnout16USA==1  
margins, at(PartyID_US_PRE_3CATEG=(0(1)2)) 	


***************************************************************************
/// 5: THE DEMOCRATIC BASE
***************************************************************************


***************************************************************************
*>>> TABLE C2 APPENDIX
*    Vote by region
***************************************************************************

*<<< Bivariate relationship: vote by region with weighting
svy: tab Vote16 Midwest , col 
svy: tab Vote16 Rustbelt , col 


***************************************************************************
*>>> TABLE C3 APPENDIX: VOTE FOR HRC AND REGION CONTROLLING FOR PARTISANSHIP
***************************************************************************

*<<< Basic logit model: Clinton vote and Midwest region controlling for partisanship with weighting
svy: logit Vote16_Clinton Midwest PartyID_US_PRE_DEM if Turnout16USA==1  


*<<< Basic logit model: Clinton vote and Rustbelt region controlling for partisanship with weighting
svy: logit Vote16_Clinton Rustbelt PartyID_US_PRE_DEM if Turnout16USA==1  


***************************************************************************
*>>> TABLE C4 APPENDIX
*    Mobilization by region
***************************************************************************

*<<< Bivariate relationship: mobilization by region with weighting
svy: tab PartyContact_DEM if Turnout16USA==1 & Midwest==1
svy: tab PartyContact_DEM if Turnout16USA==1 & Midwest==0


*<<< Bivariate relationship: mobilization by region with weighting
svy: tab PartyContact_DEM if Turnout16USA==1 & Rustbelt==1
svy: tab PartyContact_DEM if Turnout16USA==1 & Rustbelt==0


***************************************************************************
*>>> FIGURE 1: DEMOCRATIC IDENTIFIERS AND VOTE CHOICE (TOP-LEFT QUADRANT) 
*   2016 data only - data for other years from ANES Times Series File
***************************************************************************

svy: tab Vote16 PartyID_US_PRE_DEM, col 


***************************************************************************
*>>> FIGURE 1: DEMOCRATIC PRIMARY VOTERS AND VOTE IN PRES ELECTION 
*   (TOP-RIGHT QUADRANT) 
*   2016 data only - data for other years from ANES Times Series File
***************************************************************************

svy: tab Vote16 VotePRIM16_DEMS, col 
svy: tab Vote16 VotePRIM16_Clinton, col 
svy: tab Vote16 VotePRIM16_Sanders, col 


***************************************************************************
*>>> FIGURE 1: DEMOCRATIC PRIMARY VOTERS AND VOTE IN PRES ELECTION 
*   (BOTTOM-LEFT QUADRANT) 
*   2016 data only - data for other years from ANES Times Series File
***************************************************************************

svy: tab Vote16 Income4_PRE_3CAT


***************************************************************************
*>>> FIGURE 1: INCOME AND VOTE (BOTTOM-LEFT QUADRANT)
***************************************************************************

svy: tab Vote16 Income4_PRE_3CAT


***************************************************************************
*>>> FIGURE 1: INCOME AND VOTE (BOTTOM-RIGHT QUADRANT)
***************************************************************************

*<<< Bivariate relationship: Clinton vote by income with weighting
svy: logit Vote16_Clinton Income4_PRE_3CAT PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(Income4_PRE_3CAT=(1(1)3)) 										



***************************************************************************
/// 6: CULTURAL ANXIETY - ANGER AT IMMIGRANTS AND MINORIITES
***************************************************************************

***************************************************************************
*>>> TABLE C5 APPENDIX
*    Racial Stereotype index - African Americans - Frequency with weighting
***************************************************************************

svy: tab Race_BlackStereo_Scale2 if Turnout16USA==1


***************************************************************************
*>>> TABLE C6 APPENDIX
*    Racial Stereotype index - Hispanics - Frequency with weighting
***************************************************************************

svy: tab Race_HispStereo_Scale2 if Turnout16USA==1


***************************************************************************
*>>> FIGURE 2: ATTITUDES TO MINORITIES (TOP-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and African-American stereotype index with weighting
svy: tab Vote16 Race_BlackStereo_Scale2 , col 


***************************************************************************
*>>> FIGURE 2: ATTITUDES TO MINORITIES (TOP-RIGHT-QUADRANT)
     (Model detailed in Table C7 appendix)
***************************************************************************

*<<< Basic Logit model of Clinton vote, African American stereotype controlling for partisanship
svy: logit Vote16_Clinton Race_BlackStereo_Scale2 PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(Race_BlackStereo_Scale2=(1(1)7)) 										


***************************************************************************
*>>> FIGURE 2: ATTITUDES TO MINORITIES (BOTTOM-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and Hispanic stereotype index with weighting
svy: tab Vote16 Race_HispStereo_Scale2 , col 


***************************************************************************
*>>> FIGURE 2: ATTITUDES TO MINORITIES (BOTTOM-RIGHT-QUADRANT)
     (Model detailed in Table C7 appendix)
***************************************************************************

*<<< Clinton vote, Hispanic stereotype controlling for partisanship
svy: logit Vote16_Clinton Race_HispStereo_Scale2 PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(Race_HispStereo_Scale2=(1(1)7)) 										


***************************************************************************
*>>> TABLE C8 APPENDIX
*    Immigration Index - Frequency with weighting
***************************************************************************

svy: tab AntiImmigration_2 if Turnout16USA==1


***************************************************************************
*>>> FIGURE 3: ATTITUDES TO IMMIGRATION (LEFT-PORTION)
***************************************************************************

*<<< Bivariate relationship: vote and immigration index with weighting
svy: tab Vote16 AntiImmigration_2 , col 


***************************************************************************
*>>> FIGURE 3: ATTITUDES TO IMMIGRATION (RIGHT-PORTION)
     (Model detailed in Table C9 appendix)
***************************************************************************

*<<< Clinton vote, immigration index controlling for partisanship

*<<< Basic logit model: Clinton vote and immigration index controlling for partisanship with weighting
svy: logit Vote16_Clinton AntiImmigration_2 PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(AntiImmigration_2=(1(1)5)) 										


***************************************************************************
/// 7: IT'S THE ECONOMY STUPID
***************************************************************************

***************************************************************************
*>>> TABLE C10 APPENDIX
*    Valence economy - Frequency with weighting
***************************************************************************

svy: tab EconomySocio_BetterWorseYr_Retro if Turnout16USA==1


***************************************************************************
*>>> FIGURE C2: ATTITUDES TO ECONOMY (TOP-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and valence economy with weighting
tab Vote16 EconomySocio_BetterWorseYr_Retro , col chi2 taub


***************************************************************************
*>>> FIGURE C2: ATTITUDES TO ECONOMY (TOP-RIGHT-QUADRANT)
     (Model detailed in Table C12 appendix)
***************************************************************************

*<<< Basic logit model: Clinton vote and valence economics controlling for partisanship with weighting
svy: logit Vote16_Clinton EconomySocio_BetterWorseYr_Retro PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(EconomySocio_BetterWorseYr_Retro=(-1(1)1)) 		


***************************************************************************
*>>> TABLE C11 APPENDIX
*    Positional economy Free Trade - Frequency with weighting
***************************************************************************

svy: tab Eco_FreeTradeAgree if Turnout16USA==1


***************************************************************************
*>>> FIGURE C2: ATTITUDES TO ECONOMY (BOTTOM-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and valence economy with weighting
tab Vote16 Eco_FreeTradeAgree , col chi2 taub


***************************************************************************
*>>> FIGURE C2: ATTITUDES TO ECONOMY (BOTTOM-RIGHT-QUADRANT)
     (Model detailed in Table C12 appendix)
***************************************************************************

*<<< Basic logit model: Clinton vote and positional eco free controlling for partisanship with weighting
svy: logit Vote16_Clinton Eco_FreeTradeAgree PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(Eco_FreeTradeAgree=(0(1)2)) 


***************************************************************************
/// 8. CANDIDATE PERSONALITY AND GENDER: DINGED!
***************************************************************************

***************************************************************************
*>>> MENTION GENDER AS A REASON NOT TO LIKE HRC (mentioned in text)
***************************************************************************

svy: tab ClintonDislike_Gender if Turnout16USA==1


***************************************************************************
*>>> TABLE C13 APPENDIX
*    Traditional Women Index - Frequency with weighting
***************************************************************************

svy: tab TradWomenIndex_2 if Turnout16USA==1


***************************************************************************
*>>> FIGURE 4: ATTITUDES TO WOMEN (TOP-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and traditional women index with weighting
svy: tab Vote16 TradWomenIndex_2 , col 


***************************************************************************
*>>> FIGURE 4: ATTITUDES TO WOMEN (TOP-RIGHT-QUADRANT)
     (Model detailed in Table C15 appendix)
***************************************************************************

*<<< Basic logit model: Clinton vote and traditional women index controlling for partisanship with weighting
svy: logit Vote16_Clinton TradWomenIndex_2 PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(TradWomenIndex_2=(0(1)1)) 										


***************************************************************************
*>>> TABLE C14 APPENDIX
*    Sexism Index - Frequency with weighting
***************************************************************************

*<<< Frequency with weighting
svy: tab HostileSexismIndex_2 if Turnout16USA==1


***************************************************************************
*>>> FIGURE 4: SEXIST ATTITUDES (BOTTOM-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and sexism index with weighting
svy: tab Vote16 HostileSexismIndex_2 , col 


***************************************************************************
*>>> FIGURE 4: ATTITUDES TO WOMEN (BOTTOM-RIGHT-QUADRANT)
     (Model detailed in Table C15 appendix)
***************************************************************************

*<<< Basic logit model: Clinton vote and sexism index controlling for partisanship with weighting
svy: logit Vote16_Clinton HostileSexismIndex_2 PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(HostileSexismIndex_2=(1(1)5)) 										


***************************************************************************
*>>> FIGURE 5: ATTITUDES TO HRC DISTRIBUTION (TOP-LEFT-QUADRANT)
***************************************************************************

 svy: tab ClintonDislikeMention if Turnout16USA==1


***************************************************************************
*>>> FIGURE 5: ATTITUDES TO HRC DISTRIBUTION BY ISSUE (TOP-RIGHT-QUADRANT)
***************************************************************************

*<<< PERSONALITY - Frequency with weighting
svy: tab ClintonDislike_Personality if Turnout16USA==1
svy: tab ClintonDislike_Personality if Turnout16USA==1 & ClintonDislikeMention==1


*<<< POLICY - Frequency with weighting
svy: tab ClintonDislike_Policy if Turnout16USA==1
svy: tab ClintonDislike_Policy if Turnout16USA==1 & ClintonDislikeMention==1


*<<< BENGHAZI - Frequency with weighting
svy: tab ClintonDislike_Benghazi if Turnout16USA==1
svy: tab ClintonDislike_Benghazi if Turnout16USA==1 & ClintonDislikeMention==1


*<<< QUALIFCATIONS/EXPERIENCE - Frequency with weighting
svy: tab ClintonDislike_Qual if Turnout16USA==1
svy: tab ClintonDislike_Qual if Turnout16USA==1 & ClintonDislikeMention==1


***************************************************************************
*>>> FIGURE 5: ATTITUDES TO HRC AND VOTE (BOTTOM-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and dislikes HRC personality with weighting
svy: tab Vote16 ClintonDislike_Personality , col 


***************************************************************************
*>>> FIGURE 5: ATTITUDES TO WOMEN (BOTTOM-RIGHT-QUADRANT)
     (Model detailed in Table C16 appendix)
***************************************************************************

*<<< Basic logit model: Clinton vote and dislikes HRC personality controlling for partisanship with weighting
svy: logit Vote16_Clinton ClintonDislike_Personality PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(ClintonDislike_Personality=(-1(1)1)) 										


***************************************************************************
/// 9: THE CAMPAIGN - EMAILS AND COMEY
***************************************************************************

***************************************************************************
*>>> TABLE C17 APPENDIX
*    Follow politics in the media 
***************************************************************************

svy: tab FollowPolinMedia if Turnout16USA==1


***************************************************************************
*>>> FIGURE 6: VOTE CHOICE BY ATTENTION TO MEDIA (TOP-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: Clinton vote and follow politics in the media with weighting
svy: tab Vote16 FollowPolinMedia , col 


***************************************************************************
*>>> FIGURE 6: VOTERS MENTIONING EMAIL AS A REASON FOR DISLIKING HRC (TOP-RIGHT-QUADRANT)
***************************************************************************

svy: tab ClintonDislike_Email if Turnout16USA==1
svy: tab ClintonDislike_Email if Turnout16USA==1 & ClintonDislikeMention==1


***************************************************************************
*>>> FIGURE 6: VOTERS MENTIONING DISLIKE OF HRC BECAUSE OF EMAIL AND VOTE  
     (BOTTOM-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and dislikes HRC personality with weighting
svy: tab Vote16 ClintonDislike_Email , col 


***************************************************************************
*>>> FIGURE 6: E-MAIL (BOTTOM-RIGHT-QUADRANT)
     (Model detailed in Table C16 appendix)
***************************************************************************

*<<< Basic logit model: Clinton vote and dislikes HRC personality controlling for partisanship with weighting
svy: logit Vote16_Clinton ClintonDislike_Email PartyID_US_PRE_DEM if Turnout16USA==1  
margins, at(ClintonDislike_Email=(-1(1)1)) 										


***************************************************************************
*>>> FIGURE 7: VOTE CHOICE - TIME OF VOTE DECISION (MADE UP MIND)
     (TOP-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and when you made up mind with weighting
svy: tab Vote16 MakeUpMindVote , col 


***************************************************************************
*>>> FIGURE 7: VOTE CHOICE PRE AND POST COMEY
     (TOP-RIGHT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and date of interview PRE with weighting
svy: tab Vote16 DOI_PRE , col 


***************************************************************************
*>>> FIGURE 7: CITIZEN FORCEAST AND VOTE CHOICE - PRE/POST COMEY 
     (BOTTOM-LEFT-QUADRANT)
***************************************************************************

*<<< Bivariate relationship: vote and citizen forecast pre/post Comey with weighting
svy:tab CitizenForecast DOI_PRE if Turnout16USA==1, col 


***************************************************************************
*>>> FIGURE 7: FEELINGS TOWARDS HILLARY CLINTON - PRE/POST ELECTION INTERVIEW
     (BOTTOM-RIGHT-QUADRANT)
***************************************************************************

svy: tab Thermom_Clinton_DiffPREPOST2 if Turnout16USA==1


***************************************************************************
/// 10: THE RELATIVE IMPORTANCE: MULTIVARIATE ANAYLSIS
***************************************************************************

***************************************************************************
*>>> DROP MISSING VALUES OF PRIMARY INDEPENDENT VARIABLES 
* To allow for models to be estimated with same number of cases
***************************************************************************

drop if mi(ConLibSelf_POST)
drop if mi(Race_BlackStereo_Scale2)
drop if mi(Race_HispStereo_Scale2)
drop if mi(AntiImmigration_2)
drop if mi(EconomySocio_BetterWorseYr_Retro)
drop if mi(Eco_FreeTradeAgree)
drop if mi(TradWomenIndex_2)
drop if mi(ClintonDislike_Personality)
drop if mi(ClintonDislike_Email)
drop if mi(ClintonDislike_Personality3)
drop if mi(ClintonDislike_Email3)
drop if mi(HostileSexismIndex_2)


***************************************************************************
*>>> TABLE 1 
* Logit model of 2016 US Presidential election explaining vote choice 
  based on the Hillary Hypothesis 
***************************************************************************

*<<< Full model with weighting
svy: logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 EconomySocio_BetterWorseYr_Retro Eco_FreeTradeAgree TradWomenIndex_2 HostileSexismIndex_2 ClintonDislike_Personality ClintonDislike_Email if Turnout16USA==1  


*<<< Full model no weighting
logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 EconomySocio_BetterWorseYr_Retro Eco_FreeTradeAgree TradWomenIndex_2 HostileSexismIndex_2 ClintonDislike_Personality ClintonDislike_Email if Turnout16USA==1  


*<<< Margins Age
margins, at(Age=(18(6)90)) 										


*<<< Margins Education_Uni
margins, at(Education_Uni=(0(1)1)) 										


*<<< Margins Midwest
margins, at(Midwest=(0(1)1)) 										


*<<< Margins Female
margins, at(Female=(0(1)1)) 


*<<< Margins Race_Black
margins, at(Race_Black=(0(1)1)) 										


*<<< Margins Party ID
margins, at(PartyID_US_PRE_DEM=(0(1)1)) 										


*<<< Margins Con LibSelf
margins, at(ConLibSelf_POST=(1(1)7)) 										


*<<< Margins Immigration
margins, at(AntiImmigration_2=(1(1)5)) 										


*<<< Margins: Stereotypes of African Americans
margins, at(Race_BlackStereo_Scale2=(1(1)7)) 										


*<<< Margins: Stereotypes of Hispanics
margins, at(Race_HispStereo_Scale2=(1(1)7)) 										


*<<< Margins Economic Valence
margins, at(EconomySocio_BetterWorseYr_Retro=(-1(1)1)) 										


*<<< Margins Economic: Positional
margins, at(Eco_FreeTradeAgree=(0(1)1)) 										


*<<< Margins Traditional Women Index
margins, at (TradWomenIndex_2=(0(1)1))


*<<< Margins Hostile Sexism
margins, at(HostileSexismIndex_2=(1(1)5)) 										


*<<< Margins Personality
margins, at(ClintonDislike_Personality=(-1(1)1)) 										


*<<< Margins E-mail
margins, at(ClintonDislike_Email=(-1(1)1)) 										


***************************************************************************
*>>> TABLE C18 APPENDIX
* Logit models of 2016 US Presidential election explaining vote choice 
  based on the Hillary Hypothesis 
  Weighted models reported in appendix
***************************************************************************

*<<< Model 1: Demographics, Partisanship, and ideology with weighting
logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST if Turnout16USA==1  


*<<< Model 1: Demographics, Partisanship, and ideology no weighting
svy: logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST if Turnout16USA==1  


*<<< Model 2: Demographics, Partisanship, ideology, and cultural with weighting
svy: logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 if Turnout16USA==1  


*<<< Model 2: Demographics, Partisanship, ideology, and cultural no weighting
logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 if Turnout16USA==1  


*<<< Model 3: Demographics, Partisanship, ideology, cultural, and economics with weighting
svy: logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 EconomySocio_BetterWorseYr_Retro Eco_FreeTradeAgree if Turnout16USA==1  


*<<< Model 3: Demographics, Partisanship, ideology, cultural, and economics no weighting
logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 EconomySocio_BetterWorseYr_Retro Eco_FreeTradeAgree if Turnout16USA==1  


*<<< Model 4: Demographics, Partisanship, ideology, cultural, economics, and personality with weighting
svy: logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 EconomySocio_BetterWorseYr_Retro Eco_FreeTradeAgree TradWomenIndex_2 HostileSexismIndex_2 ClintonDislike_Personality if Turnout16USA==1  


*<<< Model 4: Demographics, Partisanship, ideology, cultural, economics, and personality no weighting
svy: logit Vote16_Clinton Age Education_Uni Midwest Race_Black Female PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 Race_BlackStereo_Scale2 Race_HispStereo_Scale2 EconomySocio_BetterWorseYr_Retro Eco_FreeTradeAgree TradWomenIndex_2 HostileSexismIndex_2 ClintonDislike_Personality if Turnout16USA==1  


***************************************************************************
*>>> TABLE 2 
* Logit model of 2016 US Presidential election explaining vote choice 
  based on the Hillary Hypothesis 
***************************************************************************


***************************************************************************
/// 11: HRC SCORECARD
***************************************************************************

***************************************************************************
*>>> 4: STANDARD DEVIATIONS OF VARIABLES
** To get this estimate for each variable you need to use the egen function  
** which creates a new variable and provides you the estimate. 
** Note: Please run on full dataset
***************************************************************************

*<<< Party identification  
summarize PartyID_US_PRE_DEM ConLibSelf_POST AntiImmigration_2 EconomySocio_BetterWorseYrRetro TradWomenIndex_2 ClintonDislike_Personality if Turnout16USA==1


***************************************************************************
*>>> 4: AVERAGE DEVIATION ESTIMATES OF VARIABLES
** To get this estimate for each variable you need to use the egen function  
** which creates a new variable and provides you the estimate. 
** Note: Please run on full dataset
***************************************************************************

*<<< Party identification  
egen PartyID_US_PRE_DEM_M=mdev(PartyID_US_PRE_DEM) 
tab PartyID_US_PRE_DEM_M 


*<<< Ideology
egen ConLibSelf_POST_M=mdev(ConLibSelf_POST)
tab ConLibSelf_POST_M 


*<<< Immigration
egen AntiImmigration_2_M=mdev(AntiImmigration_2)
tab AntiImmigration_2_M


*<<< Economy
egen EconomySocio_BetterWorseYrRetroM=mdev(EconomySocio_BetterWorseYr_Retro)
tab EconomySocio_BetterWorseYrRetroM


*<<< Traditional women's index
egen TradWomenIndex_2_M=mdev(TradWomenIndex_2)
tab TradWomenIndex_2_M

** HRC personality 
egen ClintonDislike_Personality_M=mdev(ClintonDislike_Personality)
tab ClintonDislike_Personality_M


***************************************************************************
*>>> TABLE 2
** Calculations for estimated HRC vote share impact conducted in MS Excel
** using the values derived from here. Please see seperate file. 
***************************************************************************

// END OF FILE